package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.SymptomService;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.SymptomDelDto;
import com.ccys.db.dto.masterData.SymptomPageQueryDto;
import com.ccys.db.dto.masterData.SymptomSaveDto;
import com.ccys.db.vo.masterData.SymptomPageVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: WhiteCoat
 * @description: 症状接口
 * @author: ZhangJingCan
 * @create: 2023-12-12 11:23
 **/

@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-症状接口")
public class SymptomController {

    @Autowired
    private SymptomService symptomService;


    
    @PostMapping("symptom")
    @ApiOperation("保存症状")
    public ResponseResult save(SymptomSaveDto dto) {
        return symptomService.save(dto);
    }


    @PutMapping("symptom")
    @ApiOperation("修改症状")
    public ResponseResult edit(SymptomSaveDto dto) {
        return symptomService.save(dto);
    }

    
    @DeleteMapping("symptom")
    @ApiOperation("根据ID删除症状")
    public ResponseResult delete(SymptomDelDto dto) {
        return symptomService.delete(dto);
    }

    
    @GetMapping("symptom")
    @ApiOperation("分页查询症状")
    public ResponseResult<PageInfo<SymptomPageVo>, Object> findPage(SymptomPageQueryDto dto) {
        return symptomService.findPage(dto);
    }

}
